jQuery(document).ready(function() {
	
	//创建JQGRID表格
	
	var grid = $("#table1").ligerGrid({
        columns: [
                  { display: '物料编号', name: 'code', width: 150 },
                  { display: '物料名称', name: 'name', width: 100},
                  { display: '型号', name: 'spec', width: 270},
                  { display: '仓库编码', name: 'whcode', width: 150,hide:true},
                  { display: '仓库名称', name: 'whname', width: 150},
                  { display: '单位', name: 'junit', width: 100 },
                  { display: '期初单价', name: 'startprice', width: 100 ,render:function(row){
                	  
                	  if(row.startprice == null || row.startprice == ''){
                		  return '0.0';
                	  }
                	  return (row.startprice).toFixed(4);
                  }},
                  { display: '本月期初库存', name: 'startquantity', width: 100 ,render:function(row){
                	  
                	  if(row.startquantity == null || row.startquantity == ''){
                		  return '0.0';
                	  }
                	  return (row.startquantity).toFixed(2);
                  }},
                  { display: '本月期初总金额', name: 'startamount', width: 100 ,render:function(row){
                	  
                	  if(row.startamount == null || row.startamount == ''){
                		  return '0.0';
                	  }
                	  return (row.startamount).toFixed(4);
                  }},
                  { display: '入库数量', name: 'inquantity', width: 100 ,render:function(row){
                	  
                	  if(row.inquantity == null || row.inquantity == ''){
                		  return '0.0';
                	  }
                	  return (row.inquantity).toFixed(2);
                  }},
                  { display: '入库总金额', name: 'inamount', width: 100 ,render:function(row){
                	  
                	  if(row.inamount == null || row.inamount == ''){
                		  return '0.0';
                	  }
                	  return (row.inamount).toFixed(4);
                  }},
                  { display: '出库数量', name: 'outquantity', width: 100 ,render:function(row){
                	  
                	  if(row.outquantity == null || row.outquantity == ''){
                		  return '0.0';
                	  }
                	  return (row.outquantity).toFixed(2);
                  }},
                  { display: '出库总金额', name: 'outamount', width: 100 ,render:function(row){
                	  
                	  if(row.outamount == null || row.outamount == ''){
                		  return '0.0';
                	  }
                	  return (row.outamount).toFixed(4);
                  }},
                  { display: '本月结余单价', name: 'endprice', width: 100, hide:true,render:function(row){
                	  
                	  if(row.endprice == null || row.endprice == ''){
                		  return '0.0';
                	  }
                	  return (row.endprice).toFixed(4);
                  }},
                  { display: '本月结余库存', name: 'endquantity', width: 100 ,render:function(row){
                	  
                	  if(row.endquantity == null || row.endquantity == ''){
                		  return '0.0';
                	  }
                	  return (row.endquantity).toFixed(2);
                  }},
                  { display: '本月结余总金额', name: 'endamount', width: 100 ,render:function(row){
                	  
                	  if(row.endamount == null || row.endamount == ''){
                		  return '0.0';
                	  }
                	  return (row.endamount).toFixed(4);
                  }}
                      ],  usePager: true,pageSize:15,pageSizeOptions :[15,30,45,60],enabledSort:false,
                      url : basic_Url+"/listfinance.do",
                      width: "100%", height:"98%", checkbox: false,rownumbers:true
                  });
	$("#pageloading").hide();
	
});
